#include "process.h"

#include <QDebug>


void Process::start(const QString &program, const QVariantList &arguments) {
    QStringList args;

    qDebug() << "Running" << program;
    // convert QVariantList from QML to QStringList for QProcess

    for (const auto &arg : arguments)
        args << arg.toString();

    //unused args

    //QProcess::startDetached(program);
    process.start(program);
    //QProcess::waitForFinished(-1);
    qDebug() << "on quick" ;
}

void Process::waitforprog()
{
    qDebug() << "Hang up" ;
    QProcess::waitForFinished(-1);
    qDebug() << "on quick" ;
}

QByteArray Process::readAll() {
    return QProcess::readAll();
}
